package com.egoo.ticket.server.controller;


import com.egoo.ticket.server.pojo.dto.MsgNotifySettingDto;
import com.egoo.ticket.server.pojo.vo.MsgSettingRelationVo;
import com.egoo.ticket.server.service.IMsgSettingRelationService;
import com.egoo.ticket.server.service.SysDictService;
import com.egoo.ticket.server.utils.common.DbResponse;
import com.egoo.ticket.server.utils.common.ResponseConstant;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.log4j.Log4j;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author donny
 * @since 2020-10-29
 */
@Log4j2
@RestController
@RequestMapping("/v1/msgSettingRelation")
@Api(value = "消息设置条件", tags = "消息设置条件",description = "消息设置条件")
public class MsgSettingRelationController extends BaseController{


	@Autowired
	IMsgSettingRelationService msgSettingRelationService;

	@RequestMapping(method = RequestMethod.POST,value = "/getData")
	@ApiOperation(value = "获取数据源",notes = "获取数据源")
	public DbResponse getData(){
		if (headerParamIsExist()){
			return new DbResponse(ResponseConstant.RES_FAIL_CODE,"userId和tenantId不能为空");
		}
		MsgSettingRelationVo data = msgSettingRelationService.getData(userId, tenantId);
		return new DbResponse(ResponseConstant.RES_SUCCESS_CODE,ResponseConstant.SELECT_SUCCESS_MSG,data);
	}

}
